//package com.molyfun.parents.activity.report.adapter;
//
//import android.content.Context;
//import android.support.v7.widget.RecyclerView;
//import android.text.TextUtils;
//import android.view.LayoutInflater;
//import android.view.View;
//import android.view.ViewGroup;
//import android.widget.TextView;
//
//import com.molyfun.parents.R;
//import com.molyfun.parents.activity.report.ReportResultActivity;
//import com.molyfun.parents.rest.bean.ReportResultResponse;
//import com.molyfun.parents.utils.StringUtils;
//import com.molyfun.parents.utils.TimeUtils;
//import com.molyfun.parents.view.HorizontalTagBar;
//
//import java.util.List;
//
//import butterknife.ButterKnife;
//import butterknife.InjectView;
//
///**
// *
// */
//public class ResultAdapter extends RecyclerView.Adapter<RecyclerView.ViewHolder> {
//    Context mContext;
//    private List<ReportResultResponse.EvaluateResultBean> mList;
//
//    public ResultAdapter(Context context) {
//        this.mContext = context;
//    }
//
//    public void refreshData(List<ReportResultResponse.EvaluateResultBean> list) {
//        this.mList = list;
//        notifyDataSetChanged();
//    }
//
//    public void clearAll(){
//        if(mList != null){
//            mList.clear();
//            notifyDataSetChanged();
//        }
//    }
//
//    public void addAll(List<ReportResultResponse.EvaluateResultBean> list) {
//        this.mList.addAll(list);
//        notifyDataSetChanged();
//    }
//
//    @Override
//    public RecyclerView.ViewHolder onCreateViewHolder(ViewGroup parent, int viewType) {
//        return new ReportResultViewHolder(LayoutInflater.from(parent.getContext())
//                .inflate(R.layout.layout_report_result_list_cell, parent, false));
//    }
//
//    @Override
//    public void onBindViewHolder(RecyclerView.ViewHolder holder, final int position) {
//
//        final ReportResultResponse.EvaluateResultBean reportBriefBean = mList.get(position);
//        ReportResultViewHolder reportResultViewHolder = (ReportResultViewHolder)holder;
//        reportResultViewHolder.mTimeInterval.setText(TimeUtils.getDateByTimeMillis(reportBriefBean.getEvaluatedatetime()) + "");
//        if(TextUtils.isEmpty(reportBriefBean.getCatename())){
//            reportResultViewHolder.mResultType.setVisibility(View.GONE);
//        }else{
//            reportResultViewHolder.mResultType.setVisibility(View.VISIBLE);
//            reportResultViewHolder.mResultType.setText(StringUtils.getSpltString(reportBriefBean.getCatename(), 8));
//        }
////        reportResultViewHolder.mResultType.
//
//        reportResultViewHolder.itemView.setOnClickListener(new View.OnClickListener() {
//            @Override
//            public void onClick(View v) {
//                ReportResultActivity.startActivity(mContext, reportBriefBean.getId(),"");
//            }
//        });
//
//    }
//
//    @Override
//    public int getItemCount() {
//        if (mList == null || mList.size() == 0) {
//            return 0;
//        }
//        return mList.size();
//    }
//
//    class ReportResultViewHolder extends RecyclerView.ViewHolder {
//
//        @InjectView(R.id.time_interval)
//        public TextView mTimeInterval;
//        @InjectView(R.id.result_type)
//        HorizontalTagBar mResultType;
//
//        public ReportResultViewHolder(View view) {
//            super(view);
//            ButterKnife.inject(this, view);
//        }
//    }
//
//}
